/*    */ package com.zimbra.qa.unittest.prov.ldap;
/*    */ 
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.ldap.LdapObjectClassHierarchy;
/*    */ import com.zimbra.cs.account.ldap.LdapProv;
/*    */ import java.util.HashSet;
/*    */ import java.util.Set;
/*    */ import org.junit.AfterClass;
/*    */ import org.junit.Assert;
/*    */ import org.junit.BeforeClass;
/*    */ import org.junit.Test;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class TestObjectClass
/*    */   extends LdapTest
/*    */ {
/*    */   private static LdapProvTestUtil provUtil;
/*    */   private static Provisioning prov;
/*    */   
/*    */   @BeforeClass
/*    */   public static void init()
/*    */     throws Exception
/*    */   {
/* 40 */     provUtil = new LdapProvTestUtil();
/* 41 */     prov = provUtil.getProv();
/*    */   }
/*    */   
/*    */   @AfterClass
/*    */   public static void cleanup() throws Exception
/*    */   {}
/*    */   
/*    */   @Test
/*    */   public void getMostSpecificOC() throws Exception
/*    */   {
/* 51 */     LdapProv ldapProv = (LdapProv)prov;
/*    */     
/* 53 */     Assert.assertEquals("inetOrgPerson", LdapObjectClassHierarchy.getMostSpecificOC(ldapProv, new String[] { "zimbraAccount", "organizationalPerson", "person" }, "inetOrgPerson"));
/*    */     
/*    */ 
/*    */ 
/* 57 */     Assert.assertEquals("inetOrgPerson", LdapObjectClassHierarchy.getMostSpecificOC(ldapProv, new String[] { "inetOrgPerson" }, "organizationalPerson"));
/*    */     
/*    */ 
/*    */ 
/* 61 */     Assert.assertEquals("inetOrgPerson", LdapObjectClassHierarchy.getMostSpecificOC(ldapProv, new String[] { "organizationalPerson", "inetOrgPerson" }, "person"));
/*    */     
/*    */ 
/*    */ 
/* 65 */     Assert.assertEquals("bbb", LdapObjectClassHierarchy.getMostSpecificOC(ldapProv, new String[] { "inetOrgPerson" }, "bbb"));
/*    */     
/*    */ 
/*    */ 
/* 69 */     Assert.assertEquals("inetOrgPerson", LdapObjectClassHierarchy.getMostSpecificOC(ldapProv, new String[] { "aaa" }, "inetOrgPerson"));
/*    */     
/*    */ 
/*    */ 
/* 73 */     Assert.assertEquals("inetOrgPerson", LdapObjectClassHierarchy.getMostSpecificOC(ldapProv, new String[] { "person", "inetOrgPerson" }, "organizationalPerson"));
/*    */   }
/*    */   
/*    */ 
/*    */   @Test
/*    */   public void getAttrsInOCs()
/*    */     throws Exception
/*    */   {
/* 81 */     LdapProv ldapProv = (LdapProv)prov;
/*    */     
/* 83 */     String[] ocs = { "amavisAccount" };
/* 84 */     Set<String> attrsInOCs = new HashSet();
/* 85 */     ldapProv.getAttrsInOCs(ocs, attrsInOCs);
/*    */     
/* 87 */     Assert.assertEquals(48L, attrsInOCs.size());
/* 88 */     Assert.assertTrue(attrsInOCs.contains("amavisBlacklistSender"));
/* 89 */     Assert.assertTrue(attrsInOCs.contains("amavisWhitelistSender"));
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/qa/unittest/prov/ldap/TestObjectClass.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */